if (($data && $data['wd'] && $data['wd'].length > 0) || ($data && $data['shbkwod'] && $data['shbkwod'].length > 0)) {
    document.title = "<{$yymc}>";
    if (document.getElementById('td_prompt100')) {
        document.getElementById('td_prompt2').innerHTML = '<img src="__CHOST__/images/secure.gif"/>&nbsp;<span class="zi" align="center" style="color:#000000!important; font-size:13px;"><{$yymc}>在线咨询平台</span>';
    }

    var shb_link = document.createElement('link'); shb_link.type = 'text/css'; shb_link.rel = 'stylesheet'; shb_link.href = '__CHOST__/style/style_swt.css'; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(shb_link)];
    var search_wd = $data['wd'] || '', shbydy1 = '1', shbydy2 = '1', shbydy3 = '', shbydy4 = '', shbkwod = $data['shbkwod'] || '', str = '';
    if (shbkwod != "111" && shbkwod != "222" && shbkwod != "333" && shbkwod != "444" && shbkwod != "555" && shbkwod != "666" && shbkwod != "777" && shbkwod != "888") {
        window.shbkwod = shbkwod;
    } else {
        window.shbkwod = '';
        shbkwod = '';
    }
    window.shbkwod = decodeURIComponent(window.shbkwod);
    window.search_wd = search_wd;
    //医生头像
    v3 = '<{$doctor_pic}>';
    v4 = '<{$kehu_pic}>';
    var divEle = document.getElementById('chatMessageArea') ? document.getElementById('chatMessageArea') : document.getElementById('messages');
    var chatHtml = divEle.innerHTML;
    if (window.search_wd != "") {
        str += '<div style="margin-right:10px;" class="msg-box"> <div class="msg-client"> <div class="client-avatar"><img src="' + v4 + '" style="width:36px;" width="40px"></div>  <div class="arrow_box">   <div class="text">' + window.search_wd + '</div>  </div> </div></div>';
    }
    <{php}>
    //对话
    foreach($duihua_arr as $val){
        echo "
        str += '<div class=\"msg-box\"><div class=\"msg-agent\"><div class=\"agent-avatar\"><img src=\"'+v3+
        '\" width=\"40px\"></div><div class=\"arrow_box_left\" style=\"margin-left:50px;\"><div class=\"text1\"></div><div class=\"text\">'+
        '".$val."'+
        '</div></div></div></div>'; 
        ";
    }

    <{/php}>
    if (divEle.childNodes.length < 5) {
        divEle.innerHTML = divEle.innerHTML + str;
    } else {
        divEle.innerHTML = str + divEle.innerHTML;
    }
    var styleKst = document.createElement('style');
    document.head.appendChild(styleKst);
    sheetKst = styleKst.sheet;
    var shb_swtkcb = '2';
    if (shb_swtkcb != '2') {
        sheetKst.insertRule('.bubble-prologue,msg-system{display:none}', 0);
    }
    var count = 0, func_clear = function () {
        var txt1arr = document.getElementsByClassName('text1'), msgboxp = '';
        for (var i = 0; i < txt1arr.length; i++) {
            if (count < 50) {
                try {
                    if (txt1arr[i].innerHTML.length > 1) {
                        msgboxp = txt1arr[i].parentNode.parentNode.parentNode;
                        if (msgboxp.className == 'msg-box') { msgboxp.style.display = 'none'; }
                        count = 50;
                    }
                } catch (exx) { }
            }
        }
        count++;
        if (count < 50) setTimeout(func_clear, 50);
    }
    var shb_swtzdyd = '1';
    if (shb_swtzdyd == '2') {
        func_clear();
    }
    var isfs = false;
    send_swt = function () {
        if (sessionStorage['ly_have_new' + window.shbkwod] != '1') {
            var isfs = false;
            var tb_texteditor = "texteditor";
            if ($("inputbox")) tb_texteditor = "inputbox";
            var shb_tC = setInterval(function () {
                if (isfs == false && sessionStorage['ly_have_new' + window.shbkwod] != '1') {
                    isfs = true; sessionStorage['ly_have_new' + window.shbkwod] = '1';
                    $(tb_texteditor).value = window.shbkwod;
                    setTimeout(function () {
                        try { inputChange(); restoreUI(); } catch (e) { }
                        User_Send();
                    }, 400);
                } else {
                    clearInterval(shb_tC);
                }
            }, 400);
        }
    }
    if (window.shbkwod != undefined && window.search_wd != window.shbkwod && window.shbkwod != "") {
        send_swt();
    }
}
setTimeout(function () {

    window.ly_prompt_11 = window.ly_prompt_11 || '觉得打字太麻烦?';
    window.ly_prompt_22 = window.ly_prompt_22 || '马上电话咨询！';
    window.ly_prompt_tel1 = window.ly_prompt_tel1 || '<{$yy_tel}>';
    window.ly_title1 = window.ly_title1 || '<{$yymc}>';

    if (window.c118 != undefined && window.c118.length > 0) {
        window.ly_prompt_tel1 = '<{$yy_tel}>';
    }
    console.log(window.c118);

    with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = '__CHOST__/js/tanchuang.js'];


}, 100)